<template>
	<div class="special-detail">
		<back-header>专栏详情</back-header>
		<div class="special-detail-main" v-if="specialDetail">
			<div class="special-detail-main-author">
				<div class="special-detail-main-author-image">
					<img src="@/assets/img/xiaosi.jpg" alt="">
				</div>
				<div class="special-detail-main-author-name">
					{{specialDetail.author || '小四'}}
				</div>
			</div>
			<div class="special-detail-main-title" v-html="specialDetail.title"></div>
			<div class="special-detail-main-image">
				<img :src="specialDetail.pic" alt="">
			</div>
			<div class="special-detail-main-content" ref="content" v-html="specialDetail.content"></div>
			<guess-like/>
		</div>
	</div>
</template>

<script>
	import News from '@/services/news';
	import backHeader from '#/Public/backHeader';
	import GuessLike from '#/Cart/GuessLike';

	const _news = new News();

	export default {
		name: "specialDetail",
		data() {
			return {
				specialDetail: null
			}
		},
		methods: {
			getSpecialDetail() {
				let id = this.$route.params.id;
				_news.getSpecialDetail(id).then(res => {
					this.specialDetail = res.data;
				})
			}
		},
		created() {
			this.getSpecialDetail();
		},
		components: {
			backHeader,
			GuessLike
		}
	}
</script>
